
{
	private ["_zombie","_playerFound","_sound","_moan","_target"];

	_zombie = _x;
	_playerFound = false;
	_sound = [
		"ryanzombiesmoan1",
		"ryanzombiesmoan2",
		"ryanzombiesmoan3",
		"ryanzombiesmoan4",
		"ryanzombiesmoan5",
		"ryanzombiesmoan6",
		"ryanzombiesmoan7"
	];

	_target = [];

	if (time - 15 >= AfterlifeServerZombieMoanedAt) then
	{
		if (random 1 > 0.6) then
		{
			_moan = selectRandom _sound; [_zombie, format ["%1",_moan]] remoteExecCall ["say3d"];
		};
		AfterlifeServerZombieMoanedAt = time;
	};

	_target = [_zombie] call AfterlifeServer_zombie_findTarget;

	if (isNil "_target") then
	{
		_target = [];
	};

	if ((alive _zombie) && ((_zombie getVariable ["AfterlifeLockedOnPlayer",-1]) isEqualTo -1) && !(_target isEqualTo [])) then
	{
		[_zombie] spawn AfterlifeServer_zombie_logic;
		AfterlifeServerIdleUnit deleteAt _forEachIndex;
	};

} forEach AfterlifeServerIdleUnit;
